﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UDPPunchTest
{
    class UDPPunchTest
    {
        private int m_punch_server_listen_port = 24243;
        private string m_punch_server_public_ip = "98.234.189.71";
        /// <summary>
        /// Start the UDP punch server and client test.  
        /// The client will send one packet of data
        /// </summary>
        public void startTest( ) 
        {
            UDPPunchServer server = new UDPPunchServer(m_punch_server_listen_port);
            server.start();

            UDPPunchClient client = new UDPPunchClient("A");
            UDPPunchClient client2 = new UDPPunchClient("B");
            
            client.connect(m_punch_server_public_ip, m_punch_server_listen_port);
            client2.connect(m_punch_server_public_ip, m_punch_server_listen_port);

            client.peer_client_name = client2.client_name;
            client2.peer_client_name = client.client_name;

            client.startClientListener();
            client2.startClientListener();
        }
    }
}
